/**
 * Copyright (c) 2020 kedacom
 * OpenATC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 * http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 **/
import store from '../../../../store/index'
let images = [
  {
    id: 1,
    // name: 'East-Straight',
    name: 'openatccomponents.overview.dong',
    // img: require('./images/East-Straight.svg'),
    class: 'iconfont icon-dongzhihang'
  },
  {
    id: 5,
    // name: 'West-Straight',
    name: 'openatccomponents.overview.xi',
    // img: require('./images/West-Straight.svg'),
    class: 'iconfont icon-xizhihang'
  },
  {
    id: 13,
    // name: 'South-Straight',
    name: 'openatccomponents.overview.nan',
    // img: require('./images/South-Straight.svg'),
    class: 'iconfont icon-nanzhihang'
  },
  {
    id: 9,
    // name: 'North-Straight',
    name: 'openatccomponents.overview.bei',
    // img: require('./images/North-Straight.svg'),
    class: 'iconfont icon-beizhihang'
  },
  {
    id: 17,
    // name: 'South-Back',
    name: 'openatccomponents.overview.dongnan',
    // img: require('./images/South-Back.svg'),
    class: 'iconfont icon-dongnanzhihang'
  },
  {
    id: 21,
    // name: 'South-Back',
    name: 'openatccomponents.overview.xinan',
    // img: require('./images/South-Back.svg'),
    class: 'iconfont icon-xinanzhihang'
  },
  {
    id: 25,
    // name: 'South-Back',
    name: 'openatccomponents.overview.dongbei',
    // img: require('./images/South-Back.svg'),
    class: 'iconfont icon-dongbeizhihang'
  },
  {
    id: 29,
    // name: 'South-Back',
    name: 'openatccomponents.overview.xibei',
    // img: require('./images/South-Back.svg'),
    class: 'iconfont icon-xibeizhihang'
  }
]
const getPhase = () => {
  if (store.getters.roadDirection === 'left') {
    // 左行下，掉头图标替换
    images.forEach((img) => {
      if (img.id === 4) {
        img.class = 'iconfont icon-dongtiaotou-yinni'
      }
      if (img.id === 8) {
        img.class = 'iconfont icon-xitiaotou-yinni'
      }
      if (img.id === 12) {
        img.class = 'iconfont icon-beitiaotou-yinni'
      }
      if (img.id === 16) {
        img.class = 'iconfont icon-nantiaotou-yinni'
      }
    })
  }
  return images
}

export {getPhase}
